home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Collections: New Zealand Amiga Users Group
/
New Zealand Amiga Users Group Newsdisk v25 (1989-08)(NZAmigaUG).zip
/
New Zealand Amiga Users Group Newsdisk v25 (1989-08)(NZAmigaUG).adf
/
StrucBrowser
/
sb.src.zoo
/
SBGadget.c
< prev
next >
Wrap
C/C++ Source or Header
|
1988-06-22
|
4KB
|
113 lines
/************************************************************************
* *
* SBGadget *
* *
* 17 July 89 *
* *
*************************************************************************/
/* include not needed for Aztec C using provided makefile */
#include "sb:sb.h"
extern int level;
void PrGadget(string, gadget) char *string; struct Gadget *gadget;
{
static struct StructData structdata[] = {
{ " NextGadget", "struct Gadget *", 5, PTRSIZE },
{ "-LeftEdge", "SHORT", 2, INTSIZE },
{ "-TopEdge", "SHORT", 2, INTSIZE },
{ "-Width", "SHORT", 2, INTSIZE },
{ "-Height", "SHORT", 2, INTSIZE },
{ " Flags", "USHORT", 12, INTSIZE },
{ " Activation", "USHORT", 12, INTSIZE },
{ " GadgetType", "USHORT", 12, INTSIZE },
{ "(GadgetRender", "APTR)", 5, PTRSIZE },
{ "(SelectRender", "APTR)", 5, PTRSIZE },
{ " GadgetText", "struct IntuiText *", 5, PTRSIZE },
{ "-MutualExclude","LONG", 1, PTRSIZE },
{ "(SpecialInfo", "APTR)", 5, PTRSIZE },
{ "-GadgetID", "USHORT", 12, INTSIZE },
{ "-UserData", "APTR", 5, PTRSIZE }
};
static char *flagnames[16] = {
"GADGHBOX", "GADGHIMAGE", "GADGIMAGE", "GRELBOTTOM",
"GRELRIGHT", "GRELWIDTH", "GRELHEIGHT", "SELECTED",
"GADGDISABLED"
};
static char *activatenames[16] = {
"RELVERIFY", "GADGIMMEDIATE", "ENDGADGET", "FOLLOWMOUSE",
"RIGHTBORDER", "LEFTBORDER", "TOPBORDER", "BOTTOMBORDER",
"TOGGLESELECT", "STRINGCENTER", "STRINGRIGHT", "LONGINT",
"ALTKEYMAP", "BOOLEXTEND"
};
static char *systypenames[16] = {
"SIZING", "WDRAGGING", "SDRAGGING", "WUPFRONT",
"SUPFRONT", "WDOWNBACK", "SDOWNBACK", "CLOSE",
NULL, NULL, NULL, NULL,
"REQGADGET", "GZZGADGET", "SCRGADGET", "SYSGADET"
};
static char *applitypenames[16] = {
"BOOLGADGET", "GADGET0002", "PROPGADGET", "STRGADGET",
NULL, NULL, NULL, NULL,
NULL, NULL, NULL, NULL,
"REQGADGET", "GZZGADGET", "SCRGADGET", "SYSGADGET"
};
int sum, choice = -1;
USHORT bits;
level++;
while (choice) {
sum = SetOptionText(string, structdata,
(APTR)gadget, DATASIZE, 0);
switch (choice = GetChoice(DATASIZE)) {
case 1:
if (gadget->NextGadget)
PrGadget("The next gadget in Intuition's list", gadget->NextGadget);
break;
case 6:
bits = gadget->Flags;
switch (bits & GADGHIGHBITS) {
case 0:
flagnames[0] = "GADGHCOMP";
bits |= 0x01;
break;
case 1:
flagnames[0] = "GADGHBOX";
break;
case 2:
flagnames[1] = "GADGHIMAGE";
break;
case 3:
flagnames[1] = "GADGHNONE";
bits ^= 0x01;
break;
}
FlagPrint("Flags set for this gadget", flagnames, (ULONG)bits);
break;
case 7:
FlagPrint("Activation flags set for this gadget",
activatenames, (ULONG)gadget->Activation);
break;
case 8:
bits = gadget->GadgetType;
if (bits & SYSGADGET) {
bits = (bits & 0xff00) | (1 << (((bits & 0xf0) >> 4) - 1));
FlagPrint("Gadget type flags set for this gadget",
systypenames, (ULONG)bits);
}
else {
bits = (bits & 0xff00) | (1 << ((bits & 0x0f) - 1));
FlagPrint("Gadget type flags set for this gadget",
applitypenames, (ULONG)bits);
}
break;
case 11:
if (gadget->GadgetText)
PrIntuiText("The gadget's first text (IntuiText structure)",
gadget->GadgetText);
break;
}
}
level--;
}